<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pytils.numeral</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pytils-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pytils-module.html">Package&nbsp;pytils</a> ::
        Module&nbsp;numeral
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript: void(0);" class="privatelink"
    onclick="toggle_private();">hide private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pytils.numeral-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pytils.numeral-module.html">Module pytils.numeral</a></h1>
<pre class="py-src">
<span class="py-lineno">  1</span>  <span class="py-line"><span class="py-comment"># -*- coding: utf-8 -*-</span> </span>
<span class="py-lineno">  2</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># -*- test-case-name: pytils.test.test_numeral -*-</span> </span>
<span class="py-lineno">  3</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># License: GNU GPL2</span> </span>
<span class="py-lineno">  4</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># Author: Pythy &lt;the.pythy@gmail.com&gt;</span> </span>
<span class="py-lineno">  5</span>  <span class="py-line"><span class="py-comment"></span><span class="py-docstring">"""</span> </span>
<span class="py-lineno">  6</span>  <span class="py-line"><span class="py-docstring">Plural forms and in-word representation for numerals.</span> </span>
<span class="py-lineno">  7</span>  <span class="py-line"><span class="py-docstring">"""</span> </span>
<span class="py-lineno">  8</span>  <span class="py-line"> </span>
<span class="py-lineno">  9</span>  <span class="py-line"><span id="link-0" class="py-name"><a title="pytils.__id__
pytils.dt.__id__
pytils.numeral.__id__
pytils.templatetags.__id__
pytils.templatetags.pytils_dt.__id__
pytils.templatetags.pytils_numeral.__id__
pytils.templatetags.pytils_translit.__id__
pytils.test.__id__
pytils.test.test_dt.__id__
pytils.test.test_numeral.__id__
pytils.test.test_translit.__id__
pytils.test.test_utils.__id__
pytils.translit.__id__
pytils.utils.__id__" class="py-name" href="#" onclick="doclink('link-0', '__id__', 'Variable pytils.__id__=pytils-module.html#__id__,Variable pytils.dt.__id__=pytils.dt-module.html#__id__,Variable pytils.numeral.__id__=pytils.numeral-module.html#__id__,Variable pytils.templatetags.__id__=pytils.templatetags-module.html#__id__,Variable pytils.templatetags.pytils_dt.__id__=pytils.templatetags.pytils_dt-module.html#__id__,Variable pytils.templatetags.pytils_numeral.__id__=pytils.templatetags.pytils_numeral-module.html#__id__,Variable pytils.templatetags.pytils_translit.__id__=pytils.templatetags.pytils_translit-module.html#__id__,Variable pytils.test.__id__=pytils.test-module.html#__id__,Variable pytils.test.test_dt.__id__=pytils.test.test_dt-module.html#__id__,Variable pytils.test.test_numeral.__id__=pytils.test.test_numeral-module.html#__id__,Variable pytils.test.test_translit.__id__=pytils.test.test_translit-module.html#__id__,Variable pytils.test.test_utils.__id__=pytils.test.test_utils-module.html#__id__,Variable pytils.translit.__id__=pytils.translit-module.html#__id__,Variable pytils.utils.__id__=pytils.utils-module.html#__id__'); return false;">__id__</a></span></span> <span class="py-op">=</span> <span id="link-1" class="py-name"><a title="pytils.__revision__
pytils.dt.__revision__
pytils.numeral.__revision__
pytils.templatetags.__revision__
pytils.templatetags.pytils_dt.__revision__
pytils.templatetags.pytils_numeral.__revision__
pytils.templatetags.pytils_translit.__revision__
pytils.test.__revision__
pytils.test.test_dt.__revision__
pytils.test.test_numeral.__revision__
pytils.test.test_translit.__revision__
pytils.test.test_utils.__revision__
pytils.translit.__revision__
pytils.utils.__revision__" class="py-name" href="#" onclick="doclink('link-1', '__revision__', 'Variable pytils.__revision__=pytils-module.html#__revision__,Variable pytils.dt.__revision__=pytils.dt-module.html#__revision__,Variable pytils.numeral.__revision__=pytils.numeral-module.html#__revision__,Variable pytils.templatetags.__revision__=pytils.templatetags-module.html#__revision__,Variable pytils.templatetags.pytils_dt.__revision__=pytils.templatetags.pytils_dt-module.html#__revision__,Variable pytils.templatetags.pytils_numeral.__revision__=pytils.templatetags.pytils_numeral-module.html#__revision__,Variable pytils.templatetags.pytils_translit.__revision__=pytils.templatetags.pytils_translit-module.html#__revision__,Variable pytils.test.__revision__=pytils.test-module.html#__revision__,Variable pytils.test.test_dt.__revision__=pytils.test.test_dt-module.html#__revision__,Variable pytils.test.test_numeral.__revision__=pytils.test.test_numeral-module.html#__revision__,Variable pytils.test.test_translit.__revision__=pytils.test.test_translit-module.html#__revision__,Variable pytils.test.test_utils.__revision__=pytils.test.test_utils-module.html#__revision__,Variable pytils.translit.__revision__=pytils.translit-module.html#__revision__,Variable pytils.utils.__revision__=pytils.utils-module.html#__revision__'); return false;">__revision__</a></span></span> <span class="py-op">=</span> <span class="py-string">"$Id: numeral.py 29 2006-10-21 08:28:27Z the.pythy $"</span> </span>
<span class="py-lineno"> 10</span>  <span class="py-line"><span id="link-2" class="py-name"><a title="pytils.__url__
pytils.dt.__url__
pytils.numeral.__url__
pytils.templatetags.__url__
pytils.templatetags.pytils_dt.__url__
pytils.templatetags.pytils_numeral.__url__
pytils.templatetags.pytils_translit.__url__
pytils.test.__url__
pytils.test.test_dt.__url__
pytils.test.test_numeral.__url__
pytils.test.test_translit.__url__
pytils.test.test_utils.__url__
pytils.translit.__url__
pytils.utils.__url__" class="py-name" href="#" onclick="doclink('link-2', '__url__', 'Variable pytils.__url__=pytils-module.html#__url__,Variable pytils.dt.__url__=pytils.dt-module.html#__url__,Variable pytils.numeral.__url__=pytils.numeral-module.html#__url__,Variable pytils.templatetags.__url__=pytils.templatetags-module.html#__url__,Variable pytils.templatetags.pytils_dt.__url__=pytils.templatetags.pytils_dt-module.html#__url__,Variable pytils.templatetags.pytils_numeral.__url__=pytils.templatetags.pytils_numeral-module.html#__url__,Variable pytils.templatetags.pytils_translit.__url__=pytils.templatetags.pytils_translit-module.html#__url__,Variable pytils.test.__url__=pytils.test-module.html#__url__,Variable pytils.test.test_dt.__url__=pytils.test.test_dt-module.html#__url__,Variable pytils.test.test_numeral.__url__=pytils.test.test_numeral-module.html#__url__,Variable pytils.test.test_translit.__url__=pytils.test.test_translit-module.html#__url__,Variable pytils.test.test_utils.__url__=pytils.test.test_utils-module.html#__url__,Variable pytils.translit.__url__=pytils.translit-module.html#__url__,Variable pytils.utils.__url__=pytils.utils-module.html#__url__'); return false;">__url__</a></span></span> <span class="py-op">=</span> <span class="py-string">"$URL: https://pythy.googlecode.com/svn/trunk/pytils/pytils/numeral.py $"</span> </span>
<span class="py-lineno"> 11</span>  <span class="py-line"> </span>
<span class="py-lineno"> 12</span>  <span class="py-line"><span class="py-keyword">from</span> <span id="link-3" class="py-name"><a title="pytils" class="py-name" href="#" onclick="doclink('link-3', 'pytils', 'Package pytils=pytils-module.html'); return false;">pytils</a></span></span> <span class="py-keyword">import</span> <span id="link-4" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-4', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span> </span>
<span class="py-lineno"> 13</span>  <span class="py-line"> </span>
<span class="py-lineno"> 14</span>  <span class="py-line"><span id="link-5" class="py-name"><a title="pytils.numeral.FRACTIONS" class="py-name" href="#" onclick="doclink('link-5', 'FRACTIONS', 'Variable pytils.numeral.FRACTIONS=pytils.numeral-module.html#FRACTIONS'); return false;">FRACTIONS</a></span></span> <span class="py-op">=</span> <span class="py-op">(</span> </span>
<span class="py-lineno"> 15</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 16</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1089;&#1086;&#1090;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1089;&#1086;&#1090;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1089;&#1086;&#1090;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 17</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 18</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1080;&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1080;&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1080;&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 19</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1089;&#1090;&#1086;&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1089;&#1090;&#1086;&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1089;&#1090;&#1086;&#1090;&#1099;&#1089;&#1103;&#1095;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 20</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 21</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1080;&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1080;&#1084;&#1080;&#1083;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1080;&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 22</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1089;&#1090;&#1086;&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1089;&#1090;&#1086;&#1084;&#1080;&#1083;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1089;&#1090;&#1086;&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 23</span>  <span class="py-line">    <span class="py-op">(</span><span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;&#1085;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;&#1085;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;&#1085;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 24</span>  <span class="py-line">    <span class="py-op">)</span>  <span class="py-comment">#: Forms (1, 2, 5) for fractions</span> </span>
<span class="py-lineno"> 25</span>  <span class="py-line"> </span>
<span class="py-lineno"> 26</span>  <span class="py-line"><span id="link-6" class="py-name"><a title="pytils.numeral.ONES" class="py-name" href="#" onclick="doclink('link-6', 'ONES', 'Variable pytils.numeral.ONES=pytils.numeral-module.html#ONES'); return false;">ONES</a></span></span> <span class="py-op">=</span> <span class="py-op">{</span> </span>
<span class="py-lineno"> 27</span>  <span class="py-line">    <span class="py-number">0</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u""</span><span class="py-op">,</span>       <span class="py-string">u""</span><span class="py-op">,</span>       <span class="py-string">u""</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 28</span>  <span class="py-line">    <span class="py-number">1</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1086;&#1076;&#1080;&#1085;"</span><span class="py-op">,</span>   <span class="py-string">u"&#1086;&#1076;&#1085;&#1072;"</span><span class="py-op">,</span>   <span class="py-string">u"&#1086;&#1076;&#1085;&#1086;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 29</span>  <span class="py-line">    <span class="py-number">2</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1076;&#1074;&#1072;"</span><span class="py-op">,</span>    <span class="py-string">u"&#1076;&#1074;&#1077;"</span><span class="py-op">,</span>    <span class="py-string">u"&#1076;&#1074;&#1072;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 30</span>  <span class="py-line">    <span class="py-number">3</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1090;&#1088;&#1080;"</span><span class="py-op">,</span>    <span class="py-string">u"&#1090;&#1088;&#1080;"</span><span class="py-op">,</span>    <span class="py-string">u"&#1090;&#1088;&#1080;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 31</span>  <span class="py-line">    <span class="py-number">4</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1095;&#1077;&#1090;&#1099;&#1088;&#1077;"</span><span class="py-op">,</span> <span class="py-string">u"&#1095;&#1077;&#1090;&#1099;&#1088;&#1077;"</span><span class="py-op">,</span> <span class="py-string">u"&#1095;&#1077;&#1090;&#1099;&#1088;&#1077;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 32</span>  <span class="py-line">    <span class="py-number">5</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1087;&#1103;&#1090;&#1100;"</span><span class="py-op">,</span>   <span class="py-string">u"&#1087;&#1103;&#1090;&#1100;"</span><span class="py-op">,</span>   <span class="py-string">u"&#1087;&#1103;&#1090;&#1100;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 33</span>  <span class="py-line">    <span class="py-number">6</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1096;&#1077;&#1089;&#1090;&#1100;"</span><span class="py-op">,</span>  <span class="py-string">u"&#1096;&#1077;&#1089;&#1090;&#1100;"</span><span class="py-op">,</span>  <span class="py-string">u"&#1096;&#1077;&#1089;&#1090;&#1100;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 34</span>  <span class="py-line">    <span class="py-number">7</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1089;&#1077;&#1084;&#1100;"</span><span class="py-op">,</span>   <span class="py-string">u"&#1089;&#1077;&#1084;&#1100;"</span><span class="py-op">,</span>   <span class="py-string">u"&#1089;&#1077;&#1084;&#1100;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 35</span>  <span class="py-line">    <span class="py-number">8</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1074;&#1086;&#1089;&#1077;&#1084;&#1100;"</span><span class="py-op">,</span> <span class="py-string">u"&#1074;&#1086;&#1089;&#1077;&#1084;&#1100;"</span><span class="py-op">,</span> <span class="py-string">u"&#1074;&#1086;&#1089;&#1077;&#1084;&#1100;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 36</span>  <span class="py-line">    <span class="py-number">9</span><span class="py-op">:</span> <span class="py-op">(</span><span class="py-string">u"&#1076;&#1077;&#1074;&#1103;&#1090;&#1100;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1074;&#1103;&#1090;&#1100;"</span><span class="py-op">,</span> <span class="py-string">u"&#1076;&#1077;&#1074;&#1103;&#1090;&#1100;"</span><span class="py-op">)</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 37</span>  <span class="py-line">    <span class="py-op">}</span>  <span class="py-comment">#: Forms (1, 2, 5) for ones</span> </span>
<span class="py-lineno"> 38</span>  <span class="py-line"> </span>
<span class="py-lineno"> 39</span>  <span class="py-line"><span id="link-7" class="py-name"><a title="pytils.numeral.TENS" class="py-name" href="#" onclick="doclink('link-7', 'TENS', 'Variable pytils.numeral.TENS=pytils.numeral-module.html#TENS'); return false;">TENS</a></span></span> <span class="py-op">=</span> <span class="py-op">{</span> </span>
<span class="py-lineno"> 40</span>  <span class="py-line">    <span class="py-number">0</span><span class="py-op">:</span> <span class="py-string">u""</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 41</span>  <span class="py-line">    <span class="py-comment"># 1 - &#1086;&#1089;&#1086;&#1073;&#1099;&#1081; &#1089;&#1083;&#1091;&#1095;&#1072;&#1081;</span> </span>
<span class="py-lineno"> 42</span>  <span class="py-line">    <span class="py-number">10</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1077;&#1089;&#1103;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 43</span>  <span class="py-line">    <span class="py-number">11</span><span class="py-op">:</span> <span class="py-string">u"&#1086;&#1076;&#1080;&#1085;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 44</span>  <span class="py-line">    <span class="py-number">12</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1074;&#1077;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 45</span>  <span class="py-line">    <span class="py-number">13</span><span class="py-op">:</span> <span class="py-string">u"&#1090;&#1088;&#1080;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 46</span>  <span class="py-line">    <span class="py-number">14</span><span class="py-op">:</span> <span class="py-string">u"&#1095;&#1077;&#1090;&#1099;&#1088;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 47</span>  <span class="py-line">    <span class="py-number">15</span><span class="py-op">:</span> <span class="py-string">u"&#1087;&#1103;&#1090;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 48</span>  <span class="py-line">    <span class="py-number">16</span><span class="py-op">:</span> <span class="py-string">u"&#1096;&#1077;&#1089;&#1090;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 49</span>  <span class="py-line">    <span class="py-number">17</span><span class="py-op">:</span> <span class="py-string">u"&#1089;&#1077;&#1084;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 50</span>  <span class="py-line">    <span class="py-number">18</span><span class="py-op">:</span> <span class="py-string">u"&#1074;&#1086;&#1089;&#1077;&#1084;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 51</span>  <span class="py-line">    <span class="py-number">19</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1077;&#1074;&#1103;&#1090;&#1085;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 52</span>  <span class="py-line">    <span class="py-number">2</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1074;&#1072;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 53</span>  <span class="py-line">    <span class="py-number">3</span><span class="py-op">:</span> <span class="py-string">u"&#1090;&#1088;&#1080;&#1076;&#1094;&#1072;&#1090;&#1100;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 54</span>  <span class="py-line">    <span class="py-number">4</span><span class="py-op">:</span> <span class="py-string">u"&#1089;&#1086;&#1088;&#1086;&#1082;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 55</span>  <span class="py-line">    <span class="py-number">5</span><span class="py-op">:</span> <span class="py-string">u"&#1087;&#1103;&#1090;&#1100;&#1076;&#1077;&#1089;&#1103;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 56</span>  <span class="py-line">    <span class="py-number">6</span><span class="py-op">:</span> <span class="py-string">u"&#1096;&#1077;&#1089;&#1090;&#1100;&#1076;&#1077;&#1089;&#1103;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 57</span>  <span class="py-line">    <span class="py-number">7</span><span class="py-op">:</span> <span class="py-string">u"&#1089;&#1077;&#1084;&#1100;&#1076;&#1077;&#1089;&#1103;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 58</span>  <span class="py-line">    <span class="py-number">8</span><span class="py-op">:</span> <span class="py-string">u"&#1074;&#1086;&#1089;&#1077;&#1084;&#1100;&#1076;&#1077;&#1089;&#1103;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 59</span>  <span class="py-line">    <span class="py-number">9</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1077;&#1074;&#1103;&#1085;&#1086;&#1089;&#1090;&#1086;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 60</span>  <span class="py-line">    <span class="py-op">}</span>  <span class="py-comment">#: Tens</span> </span>
<span class="py-lineno"> 61</span>  <span class="py-line"> </span>
<span class="py-lineno"> 62</span>  <span class="py-line"><span id="link-8" class="py-name"><a title="pytils.numeral.HUNDREDS" class="py-name" href="#" onclick="doclink('link-8', 'HUNDREDS', 'Variable pytils.numeral.HUNDREDS=pytils.numeral-module.html#HUNDREDS'); return false;">HUNDREDS</a></span></span> <span class="py-op">=</span> <span class="py-op">{</span> </span>
<span class="py-lineno"> 63</span>  <span class="py-line">    <span class="py-number">0</span><span class="py-op">:</span> <span class="py-string">u""</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 64</span>  <span class="py-line">    <span class="py-number">1</span><span class="py-op">:</span> <span class="py-string">u"&#1089;&#1090;&#1086;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 65</span>  <span class="py-line">    <span class="py-number">2</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1074;&#1077;&#1089;&#1090;&#1080;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 66</span>  <span class="py-line">    <span class="py-number">3</span><span class="py-op">:</span> <span class="py-string">u"&#1090;&#1088;&#1080;&#1089;&#1090;&#1072;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 67</span>  <span class="py-line">    <span class="py-number">4</span><span class="py-op">:</span> <span class="py-string">u"&#1095;&#1077;&#1090;&#1099;&#1088;&#1077;&#1089;&#1090;&#1072;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 68</span>  <span class="py-line">    <span class="py-number">5</span><span class="py-op">:</span> <span class="py-string">u"&#1087;&#1103;&#1090;&#1100;&#1089;&#1086;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 69</span>  <span class="py-line">    <span class="py-number">6</span><span class="py-op">:</span> <span class="py-string">u"&#1096;&#1077;&#1089;&#1090;&#1100;&#1089;&#1086;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 70</span>  <span class="py-line">    <span class="py-number">7</span><span class="py-op">:</span> <span class="py-string">u"&#1089;&#1077;&#1084;&#1100;&#1089;&#1086;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 71</span>  <span class="py-line">    <span class="py-number">8</span><span class="py-op">:</span> <span class="py-string">u"&#1074;&#1086;&#1089;&#1077;&#1084;&#1100;&#1089;&#1086;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 72</span>  <span class="py-line">    <span class="py-number">9</span><span class="py-op">:</span> <span class="py-string">u"&#1076;&#1077;&#1074;&#1103;&#1090;&#1100;&#1089;&#1086;&#1090;"</span><span class="py-op">,</span> </span>
<span class="py-lineno"> 73</span>  <span class="py-line">    <span class="py-op">}</span>  <span class="py-comment">#: Hundreds</span> </span>
<span class="py-lineno"> 74</span>  <span class="py-line"> </span>
<a name="_get_float_remainder"></a><div id="_get_float_remainder-def"><span class="py-lineno"> 75</span> <a class="py-toggle" href="#" id="_get_float_remainder-toggle" onclick="toggle('_get_float_remainder'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#_get_float_remainder">_get_float_remainder</a><span class="py-op">(</span><span class="py-param">fvalue</span><span class="py-op">,</span> <span class="py-param">signs</span><span class="py-op">=</span><span class="py-number">9</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="_get_float_remainder-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_get_float_remainder-expanded"><span class="py-lineno"> 76</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno"> 77</span>  <span class="py-line"><span class="py-docstring">    Get remainder of float, i.e. 2.05 -&gt; '05'</span> </span>
<span class="py-lineno"> 78</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno"> 79</span>  <span class="py-line"><span class="py-docstring">    @param fvalue: input value</span> </span>
<span class="py-lineno"> 80</span>  <span class="py-line"><span class="py-docstring">    @type fvalue: C{int} or C{float}</span> </span>
<span class="py-lineno"> 81</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno"> 82</span>  <span class="py-line"><span class="py-docstring">    @param signs: maximum number of signs</span> </span>
<span class="py-lineno"> 83</span>  <span class="py-line"><span class="py-docstring">    @type signs: C{int}</span> </span>
<span class="py-lineno"> 84</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno"> 85</span>  <span class="py-line"><span class="py-docstring">    @return: remainder</span> </span>
<span class="py-lineno"> 86</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{str}</span> </span>
<span class="py-lineno"> 87</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno"> 88</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: fvalue neither C{int}, no C{float}</span> </span>
<span class="py-lineno"> 89</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: fvalue is negative    </span> </span>
<span class="py-lineno"> 90</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: signs overflow</span> </span>
<span class="py-lineno"> 91</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno"> 92</span>  <span class="py-line">    <span id="link-9" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-9', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-10" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-10', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'fvalue'</span><span class="py-op">,</span> <span class="py-op">(</span><span class="py-name">int</span><span class="py-op">,</span> <span class="py-name">float</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno"> 93</span>  <span class="py-line">    <span id="link-11" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-11', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-12" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-12', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'fvalue'</span><span class="py-op">)</span> </span>
<span class="py-lineno"> 94</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">isinstance</span><span class="py-op">(</span><span class="py-name">fvalue</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno"> 95</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-string">"0"</span> </span>
<span class="py-lineno"> 96</span>  <span class="py-line"> </span>
<span class="py-lineno"> 97</span>  <span class="py-line">    <span class="py-name">signs</span> <span class="py-op">=</span> <span class="py-name">min</span><span class="py-op">(</span><span class="py-name">signs</span><span class="py-op">,</span> <span class="py-name">len</span><span class="py-op">(</span><span id="link-13" class="py-name"><a title="pytils.numeral.FRACTIONS" class="py-name" href="#" onclick="doclink('link-13', 'FRACTIONS', 'Variable pytils.numeral.FRACTIONS=pytils.numeral-module.html#FRACTIONS'); return false;">FRACTIONS</a></span></span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno"> 98</span>  <span class="py-line"> </span>
<span class="py-lineno"> 99</span>  <span class="py-line">    <span class="py-comment"># &#1085;&#1091;&#1078;&#1085;&#1086; remainder &#1074; &#1089;&#1090;&#1088;&#1086;&#1082;&#1077;, &#1087;&#1086;&#1090;&#1086;&#1084;&#1091; &#1095;&#1090;&#1086; &#1076;&#1088;&#1086;&#1073;&#1085;&#1099;&#1077; X.0Y</span> </span>
<span class="py-lineno">100</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-comment"># &#1073;&#1091;&#1076;&#1091;&#1090; "&#1083;&#1086;&#1084;&#1072;&#1090;&#1100;&#1089;&#1103;" &#1076;&#1086; X.Y</span> </span>
<span class="py-lineno">101</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">remainder</span> <span class="py-op">=</span> <span class="py-name">str</span><span class="py-op">(</span><span class="py-name">fvalue</span><span class="py-op">)</span><span class="py-op">.</span><span class="py-name">split</span><span class="py-op">(</span><span class="py-string">'.'</span><span class="py-op">)</span><span class="py-op">[</span><span class="py-number">1</span><span class="py-op">]</span> </span>
<span class="py-lineno">102</span>  <span class="py-line">    <span class="py-name">iremainder</span> <span class="py-op">=</span> <span class="py-name">int</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span> </span>
<span class="py-lineno">103</span>  <span class="py-line">    <span class="py-name">orig_remainder</span> <span class="py-op">=</span> <span class="py-name">remainder</span> </span>
<span class="py-lineno">104</span>  <span class="py-line">    <span class="py-name">factor</span> <span class="py-op">=</span> <span class="py-name">len</span><span class="py-op">(</span><span class="py-name">str</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span><span class="py-op">)</span> <span class="py-op">-</span> <span class="py-name">signs</span> </span>
<span class="py-lineno">105</span>  <span class="py-line"> </span>
<span class="py-lineno">106</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">factor</span> <span class="py-op">&gt;</span> <span class="py-number">0</span><span class="py-op">:</span> </span>
<span class="py-lineno">107</span>  <span class="py-line">        <span class="py-comment"># &#1087;&#1086;&#1089;&#1083;&#1077; &#1079;&#1072;&#1087;&#1103;&#1090;&#1086;&#1081; &#1094;&#1080;&#1092;&#1088; &#1073;&#1086;&#1083;&#1100;&#1096;&#1077; &#1095;&#1077;&#1084; signs, &#1086;&#1082;&#1088;&#1091;&#1075;&#1083;&#1103;&#1077;&#1084;</span> </span>
<span class="py-lineno">108</span>  <span class="py-line"><span class="py-comment"></span>        <span class="py-name">iremainder</span> <span class="py-op">=</span> <span class="py-name">int</span><span class="py-op">(</span><span class="py-name">round</span><span class="py-op">(</span><span class="py-name">iremainder</span> <span class="py-op">/</span> <span class="py-op">(</span><span class="py-number">10.0</span><span class="py-op">**</span><span class="py-name">factor</span><span class="py-op">)</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">109</span>  <span class="py-line">    <span class="py-name">format</span> <span class="py-op">=</span> <span class="py-string">"%%0%dd"</span> <span class="py-op">%</span> <span class="py-name">min</span><span class="py-op">(</span><span class="py-name">len</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-name">signs</span><span class="py-op">)</span> </span>
<span class="py-lineno">110</span>  <span class="py-line"> </span>
<span class="py-lineno">111</span>  <span class="py-line">    <span class="py-name">remainder</span> <span class="py-op">=</span> <span class="py-name">format</span> <span class="py-op">%</span> <span class="py-name">iremainder</span> </span>
<span class="py-lineno">112</span>  <span class="py-line"> </span>
<span class="py-lineno">113</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">len</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span> <span class="py-op">&gt;</span> <span class="py-name">signs</span><span class="py-op">:</span> </span>
<span class="py-lineno">114</span>  <span class="py-line">        <span class="py-comment"># &#1087;&#1088;&#1080; &#1086;&#1082;&#1088;&#1091;&#1075;&#1083;&#1077;&#1085;&#1080;&#1080; &#1094;&#1080;&#1092;&#1088; &#1074;&#1080;&#1076;&#1072; 0.998 &#1088;&#1091;&#1075;&#1072;&#1090;&#1100;&#1089;&#1103;</span> </span>
<span class="py-lineno">115</span>  <span class="py-line"><span class="py-comment"></span>        <span class="py-keyword">raise</span> <span class="py-name">ValueError</span><span class="py-op">(</span><span class="py-string">"Signs overflow: I can't round only fractional part \</span> </span>
<span class="py-lineno">116</span>  <span class="py-line"><span class="py-string">                          of %s to fit %s in %d signs"</span> <span class="py-op">%</span> \ </span>
<span class="py-lineno">117</span>  <span class="py-line">                         <span class="py-op">(</span><span class="py-name">str</span><span class="py-op">(</span><span class="py-name">fvalue</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-name">orig_remainder</span><span class="py-op">,</span> <span class="py-name">signs</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">118</span>  <span class="py-line"> </span>
<span class="py-lineno">119</span>  <span class="py-line">    <span class="py-keyword">return</span> <span class="py-name">remainder</span> </span>
</div><span class="py-lineno">120</span>  <span class="py-line"> </span>
<span class="py-lineno">121</span>  <span class="py-line"> </span>
<a name="choose_plural"></a><div id="choose_plural-def"><span class="py-lineno">122</span> <a class="py-toggle" href="#" id="choose_plural-toggle" onclick="toggle('choose_plural'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#choose_plural">choose_plural</a><span class="py-op">(</span><span class="py-param">amount</span><span class="py-op">,</span> <span class="py-param">variants</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="choose_plural-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="choose_plural-expanded"><span class="py-lineno">123</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">124</span>  <span class="py-line"><span class="py-docstring">    Choose proper case depending on amount</span> </span>
<span class="py-lineno">125</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">126</span>  <span class="py-line"><span class="py-docstring">    @param amount: amount of objects</span> </span>
<span class="py-lineno">127</span>  <span class="py-line"><span class="py-docstring">    @type amount: C{int}</span> </span>
<span class="py-lineno">128</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">129</span>  <span class="py-line"><span class="py-docstring">    @param variants: variants (forms) of object in such form: </span> </span>
<span class="py-lineno">130</span>  <span class="py-line"><span class="py-docstring">        (1 object, 2 objects, 5 objects).</span> </span>
<span class="py-lineno">131</span>  <span class="py-line"><span class="py-docstring">    @type variants: 3-element C{sequence} of C{unicode}</span> </span>
<span class="py-lineno">132</span>  <span class="py-line"><span class="py-docstring">        or C{unicode} (three variants with delimeter ',')</span> </span>
<span class="py-lineno">133</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">134</span>  <span class="py-line"><span class="py-docstring">    @return: proper variant</span> </span>
<span class="py-lineno">135</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{unicode}</span> </span>
<span class="py-lineno">136</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">137</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: amount isn't C{int}, variants isn't C{sequence}</span> </span>
<span class="py-lineno">138</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: amount is negative</span> </span>
<span class="py-lineno">139</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: variants' length lesser than 3</span> </span>
<span class="py-lineno">140</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">141</span>  <span class="py-line">    <span id="link-14" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-14', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-15" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-15', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">142</span>  <span class="py-line">    <span id="link-16" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-16', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-17" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-17', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">)</span> </span>
<span class="py-lineno">143</span>  <span class="py-line">    <span id="link-18" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-18', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-19" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-19', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'variants'</span><span class="py-op">,</span> <span class="py-op">(</span><span class="py-name">list</span><span class="py-op">,</span> <span class="py-name">tuple</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">144</span>  <span class="py-line">     </span>
<span class="py-lineno">145</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">isinstance</span><span class="py-op">(</span><span class="py-name">variants</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno">146</span>  <span class="py-line">        <span class="py-name">variants</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-name">v</span><span class="py-op">.</span><span class="py-name">strip</span><span class="py-op">(</span><span class="py-op">)</span> <span class="py-keyword">for</span> <span class="py-name">v</span> <span class="py-keyword">in</span> <span class="py-name">variants</span><span class="py-op">.</span><span class="py-name">split</span><span class="py-op">(</span><span class="py-string">','</span><span class="py-op">)</span><span class="py-op">]</span> </span>
<span class="py-lineno">147</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">amount</span> <span class="py-op">%</span> <span class="py-number">10</span> <span class="py-op">==</span> <span class="py-number">1</span> <span class="py-keyword">and</span> <span class="py-name">amount</span> <span class="py-op">%</span> <span class="py-number">100</span> <span class="py-op">!=</span> <span class="py-number">11</span><span class="py-op">:</span> </span>
<span class="py-lineno">148</span>  <span class="py-line">        <span class="py-name">variant</span> <span class="py-op">=</span> <span class="py-number">0</span> </span>
<span class="py-lineno">149</span>  <span class="py-line">    <span class="py-keyword">elif</span> <span class="py-name">amount</span> <span class="py-op">%</span> <span class="py-number">10</span> <span class="py-op">&gt;=</span> <span class="py-number">2</span> <span class="py-keyword">and</span> <span class="py-name">amount</span> <span class="py-op">%</span> <span class="py-number">10</span> <span class="py-op">&lt;=</span> <span class="py-number">4</span> <span class="py-keyword">and</span> \ </span>
<span class="py-lineno">150</span>  <span class="py-line">         <span class="py-op">(</span><span class="py-name">amount</span> <span class="py-op">%</span> <span class="py-number">100</span> <span class="py-op">&lt;</span> <span class="py-number">10</span> <span class="py-keyword">or</span> <span class="py-name">amount</span> <span class="py-op">%</span> <span class="py-number">100</span> <span class="py-op">&gt;=</span> <span class="py-number">20</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno">151</span>  <span class="py-line">        <span class="py-name">variant</span> <span class="py-op">=</span> <span class="py-number">1</span> </span>
<span class="py-lineno">152</span>  <span class="py-line">    <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="py-lineno">153</span>  <span class="py-line">        <span class="py-name">variant</span> <span class="py-op">=</span> <span class="py-number">2</span> </span>
<span class="py-lineno">154</span>  <span class="py-line"> </span>
<span class="py-lineno">155</span>  <span class="py-line">    <span id="link-20" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-20', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-21" class="py-name"><a title="pytils.utils.check_length" class="py-name" href="#" onclick="doclink('link-21', 'check_length', 'Function pytils.utils.check_length()=pytils.utils-module.html#check_length'); return false;">check_length</a></span></span><span class="py-op">(</span><span class="py-string">'variants'</span><span class="py-op">,</span> <span class="py-number">3</span><span class="py-op">)</span> </span>
<span class="py-lineno">156</span>  <span class="py-line">    <span class="py-keyword">return</span> <span class="py-name">variants</span><span class="py-op">[</span><span class="py-name">variant</span><span class="py-op">]</span> </span>
</div><span class="py-lineno">157</span>  <span class="py-line"> </span>
<a name="rubles"></a><div id="rubles-def"><span class="py-lineno">158</span> <a class="py-toggle" href="#" id="rubles-toggle" onclick="toggle('rubles'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#rubles">rubles</a><span class="py-op">(</span><span class="py-param">amount</span><span class="py-op">,</span> <span class="py-param">zero_for_kopeck</span><span class="py-op">=</span><span class="py-name">False</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="rubles-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="rubles-expanded"><span class="py-lineno">159</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">160</span>  <span class="py-line"><span class="py-docstring">    Get string for money</span> </span>
<span class="py-lineno">161</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">162</span>  <span class="py-line"><span class="py-docstring">    @param amount: amount of money</span> </span>
<span class="py-lineno">163</span>  <span class="py-line"><span class="py-docstring">    @type amount: C{int} or C{float}</span> </span>
<span class="py-lineno">164</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">165</span>  <span class="py-line"><span class="py-docstring">    @param zero_for_kopeck: If false, then zero kopecks ignored</span> </span>
<span class="py-lineno">166</span>  <span class="py-line"><span class="py-docstring">    @type zero_for_kopeck: C{bool}</span> </span>
<span class="py-lineno">167</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">168</span>  <span class="py-line"><span class="py-docstring">    @return: in-words representation of money's amount</span> </span>
<span class="py-lineno">169</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{unicode}</span> </span>
<span class="py-lineno">170</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">171</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: amount neither C{int}, no C{float}</span> </span>
<span class="py-lineno">172</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: amount is negative</span> </span>
<span class="py-lineno">173</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">174</span>  <span class="py-line">    <span id="link-22" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-22', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-23" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-23', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">,</span> <span class="py-op">(</span><span class="py-name">int</span><span class="py-op">,</span> <span class="py-name">float</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">175</span>  <span class="py-line">    <span id="link-24" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-24', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-25" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-25', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">)</span> </span>
<span class="py-lineno">176</span>  <span class="py-line">     </span>
<span class="py-lineno">177</span>  <span class="py-line">    <span class="py-name">pts</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="py-lineno">178</span>  <span class="py-line">    <span class="py-name">amount</span> <span class="py-op">=</span> <span class="py-name">round</span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-number">2</span><span class="py-op">)</span> </span>
<span class="py-lineno">179</span>  <span class="py-line">    <span class="py-name">pts</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-26" class="py-name"><a title="pytils.numeral.sum_string
pytils.templatetags.pytils_numeral.sum_string" class="py-name" href="#" onclick="doclink('link-26', 'sum_string', 'Function pytils.numeral.sum_string()=pytils.numeral-module.html#sum_string,Function pytils.templatetags.pytils_numeral.sum_string()=pytils.templatetags.pytils_numeral-module.html#sum_string'); return false;">sum_string</a></span></span><span class="py-op">(</span><span class="py-name">int</span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-number">1</span><span class="py-op">,</span> <span class="py-op">(</span><span class="py-string">u"&#1088;&#1091;&#1073;&#1083;&#1100;"</span><span class="py-op">,</span> <span class="py-string">u"&#1088;&#1091;&#1073;&#1083;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1088;&#1091;&#1073;&#1083;&#1077;&#1081;"</span><span class="py-op">)</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">180</span>  <span class="py-line">    <span class="py-name">remainder</span> <span class="py-op">=</span> <span id="link-27" class="py-name"><a title="pytils.numeral._get_float_remainder" class="py-name" href="#" onclick="doclink('link-27', '_get_float_remainder', 'Function pytils.numeral._get_float_remainder()=pytils.numeral-module.html#_get_float_remainder'); return false;">_get_float_remainder</a></span></span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-number">2</span><span class="py-op">)</span> </span>
<span class="py-lineno">181</span>  <span class="py-line">    <span class="py-name">iremainder</span> <span class="py-op">=</span> <span class="py-name">int</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span> </span>
<span class="py-lineno">182</span>  <span class="py-line">     </span>
<span class="py-lineno">183</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">iremainder</span> <span class="py-op">!=</span> <span class="py-number">0</span> <span class="py-keyword">or</span> <span class="py-name">zero_for_kopeck</span><span class="py-op">:</span> </span>
<span class="py-lineno">184</span>  <span class="py-line">        <span class="py-comment"># &#1077;&#1089;&#1083;&#1080; 3.1, &#1090;&#1086; &#1101;&#1090;&#1086; 10 &#1082;&#1086;&#1087;&#1077;&#1077;&#1082;, &#1072; &#1085;&#1077; &#1086;&#1076;&#1085;&#1072;</span> </span>
<span class="py-lineno">185</span>  <span class="py-line"><span class="py-comment"></span>        <span class="py-keyword">if</span> <span class="py-name">iremainder</span> <span class="py-op">&lt;</span> <span class="py-number">10</span> <span class="py-keyword">and</span> <span class="py-name">len</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span> <span class="py-op">==</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="py-lineno">186</span>  <span class="py-line">            <span class="py-name">iremainder</span> <span class="py-op">*=</span> <span class="py-number">10</span> </span>
<span class="py-lineno">187</span>  <span class="py-line">        <span class="py-name">pts</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-28" class="py-name"><a title="pytils.numeral.sum_string
pytils.templatetags.pytils_numeral.sum_string" class="py-name" href="#" onclick="doclink('link-28', 'sum_string', 'Function pytils.numeral.sum_string()=pytils.numeral-module.html#sum_string,Function pytils.templatetags.pytils_numeral.sum_string()=pytils.templatetags.pytils_numeral-module.html#sum_string'); return false;">sum_string</a></span></span><span class="py-op">(</span><span class="py-name">iremainder</span><span class="py-op">,</span> <span class="py-number">2</span><span class="py-op">,</span> </span>
<span class="py-lineno">188</span>  <span class="py-line">                              <span class="py-op">(</span><span class="py-string">u"&#1082;&#1086;&#1087;&#1077;&#1081;&#1082;&#1072;"</span><span class="py-op">,</span> <span class="py-string">u"&#1082;&#1086;&#1087;&#1077;&#1081;&#1082;&#1080;"</span><span class="py-op">,</span> <span class="py-string">u"&#1082;&#1086;&#1087;&#1077;&#1077;&#1082;"</span><span class="py-op">)</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">189</span>  <span class="py-line"> </span>
<span class="py-lineno">190</span>  <span class="py-line">    <span class="py-keyword">return</span> <span class="py-string">u" "</span><span class="py-op">.</span><span class="py-name">join</span><span class="py-op">(</span><span class="py-name">pts</span><span class="py-op">)</span> </span>
</div><span class="py-lineno">191</span>  <span class="py-line"> </span>
<a name="in_words_int"></a><div id="in_words_int-def"><span class="py-lineno">192</span> <a class="py-toggle" href="#" id="in_words_int-toggle" onclick="toggle('in_words_int'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#in_words_int">in_words_int</a><span class="py-op">(</span><span class="py-param">amount</span><span class="py-op">,</span> <span class="py-param">gender</span><span class="py-op">=</span><span class="py-number">1</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="in_words_int-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="in_words_int-expanded"><span class="py-lineno">193</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">194</span>  <span class="py-line"><span class="py-docstring">    Integer in words</span> </span>
<span class="py-lineno">195</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">196</span>  <span class="py-line"><span class="py-docstring">    @param amount: numeral</span> </span>
<span class="py-lineno">197</span>  <span class="py-line"><span class="py-docstring">    @type amount: C{int}</span> </span>
<span class="py-lineno">198</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">199</span>  <span class="py-line"><span class="py-docstring">    @param gender: gender (male=1, female=2, neuter=3)</span> </span>
<span class="py-lineno">200</span>  <span class="py-line"><span class="py-docstring">    @type gender: C{int}</span> </span>
<span class="py-lineno">201</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">202</span>  <span class="py-line"><span class="py-docstring">    @return: in-words reprsentation of numeral</span> </span>
<span class="py-lineno">203</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{unicode}</span> </span>
<span class="py-lineno">204</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">205</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: when amount is not C{int}</span> </span>
<span class="py-lineno">206</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: amount is negative</span> </span>
<span class="py-lineno">207</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">208</span>  <span class="py-line">    <span id="link-29" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-29', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-30" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-30', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">209</span>  <span class="py-line">    <span id="link-31" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-31', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-32" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-32', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">)</span> </span>
<span class="py-lineno">210</span>  <span class="py-line">     </span>
<span class="py-lineno">211</span>  <span class="py-line">    <span class="py-keyword">return</span> <span id="link-33" class="py-name"><a title="pytils.numeral.sum_string
pytils.templatetags.pytils_numeral.sum_string" class="py-name" href="#" onclick="doclink('link-33', 'sum_string', 'Function pytils.numeral.sum_string()=pytils.numeral-module.html#sum_string,Function pytils.templatetags.pytils_numeral.sum_string()=pytils.templatetags.pytils_numeral-module.html#sum_string'); return false;">sum_string</a></span></span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-name">gender</span><span class="py-op">)</span> </span>
</div><span class="py-lineno">212</span>  <span class="py-line"> </span>
<a name="in_words_float"></a><div id="in_words_float-def"><span class="py-lineno">213</span> <a class="py-toggle" href="#" id="in_words_float-toggle" onclick="toggle('in_words_float'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#in_words_float">in_words_float</a><span class="py-op">(</span><span class="py-param">amount</span><span class="py-op">,</span> <span class="py-param">_gender</span><span class="py-op">=</span><span class="py-number">2</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="in_words_float-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="in_words_float-expanded"><span class="py-lineno">214</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">215</span>  <span class="py-line"><span class="py-docstring">    Float in words</span> </span>
<span class="py-lineno">216</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">217</span>  <span class="py-line"><span class="py-docstring">    @param amount: float numeral</span> </span>
<span class="py-lineno">218</span>  <span class="py-line"><span class="py-docstring">    @type amount: C{float}</span> </span>
<span class="py-lineno">219</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">220</span>  <span class="py-line"><span class="py-docstring">    @return: in-words reprsentation of float numeral</span> </span>
<span class="py-lineno">221</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{unicode}</span> </span>
<span class="py-lineno">222</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">223</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: when amount is not C{float}</span> </span>
<span class="py-lineno">224</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: when ammount is negative</span> </span>
<span class="py-lineno">225</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">226</span>  <span class="py-line">    <span id="link-34" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-34', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-35" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-35', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">,</span> <span class="py-name">float</span><span class="py-op">)</span> </span>
<span class="py-lineno">227</span>  <span class="py-line">    <span id="link-36" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-36', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-37" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-37', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">)</span> </span>
<span class="py-lineno">228</span>  <span class="py-line">     </span>
<span class="py-lineno">229</span>  <span class="py-line">    <span class="py-name">pts</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="py-lineno">230</span>  <span class="py-line">    <span class="py-comment"># &#1087;&#1088;&#1077;&#1086;&#1073;&#1088;&#1072;&#1079;&#1091;&#1077;&#1084; &#1094;&#1077;&#1083;&#1091;&#1102; &#1095;&#1072;&#1089;&#1090;&#1100;</span> </span>
<span class="py-lineno">231</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">pts</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-38" class="py-name"><a title="pytils.numeral.sum_string
pytils.templatetags.pytils_numeral.sum_string" class="py-name" href="#" onclick="doclink('link-38', 'sum_string', 'Function pytils.numeral.sum_string()=pytils.numeral-module.html#sum_string,Function pytils.templatetags.pytils_numeral.sum_string()=pytils.templatetags.pytils_numeral-module.html#sum_string'); return false;">sum_string</a></span></span><span class="py-op">(</span><span class="py-name">int</span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-number">2</span><span class="py-op">,</span> </span>
<span class="py-lineno">232</span>  <span class="py-line">                          <span class="py-op">(</span><span class="py-string">u"&#1094;&#1077;&#1083;&#1072;&#1103;"</span><span class="py-op">,</span> <span class="py-string">u"&#1094;&#1077;&#1083;&#1099;&#1093;"</span><span class="py-op">,</span> <span class="py-string">u"&#1094;&#1077;&#1083;&#1099;&#1093;"</span><span class="py-op">)</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">233</span>  <span class="py-line">    <span class="py-comment"># &#1090;&#1077;&#1087;&#1077;&#1088;&#1100; &#1090;&#1086;, &#1095;&#1090;&#1086; &#1087;&#1086;&#1089;&#1083;&#1077; &#1079;&#1072;&#1087;&#1103;&#1090;&#1086;&#1081;</span> </span>
<span class="py-lineno">234</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">remainder</span> <span class="py-op">=</span> <span id="link-39" class="py-name"><a title="pytils.numeral._get_float_remainder" class="py-name" href="#" onclick="doclink('link-39', '_get_float_remainder', 'Function pytils.numeral._get_float_remainder()=pytils.numeral-module.html#_get_float_remainder'); return false;">_get_float_remainder</a></span></span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">)</span> </span>
<span class="py-lineno">235</span>  <span class="py-line">    <span class="py-name">signs</span> <span class="py-op">=</span> <span class="py-name">len</span><span class="py-op">(</span><span class="py-name">str</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span><span class="py-op">)</span> <span class="py-op">-</span> <span class="py-number">1</span> </span>
<span class="py-lineno">236</span>  <span class="py-line">    <span class="py-name">pts</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-40" class="py-name"><a title="pytils.numeral.sum_string
pytils.templatetags.pytils_numeral.sum_string" class="py-name" href="#" onclick="doclink('link-40', 'sum_string', 'Function pytils.numeral.sum_string()=pytils.numeral-module.html#sum_string,Function pytils.templatetags.pytils_numeral.sum_string()=pytils.templatetags.pytils_numeral-module.html#sum_string'); return false;">sum_string</a></span></span><span class="py-op">(</span><span class="py-name">int</span><span class="py-op">(</span><span class="py-name">remainder</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-number">2</span><span class="py-op">,</span> <span id="link-41" class="py-name"><a title="pytils.numeral.FRACTIONS" class="py-name" href="#" onclick="doclink('link-41', 'FRACTIONS', 'Variable pytils.numeral.FRACTIONS=pytils.numeral-module.html#FRACTIONS'); return false;">FRACTIONS</a></span></span><span class="py-op">[</span><span class="py-name">signs</span><span class="py-op">]</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">237</span>  <span class="py-line"> </span>
<span class="py-lineno">238</span>  <span class="py-line">    <span class="py-keyword">return</span> <span class="py-string">u" "</span><span class="py-op">.</span><span class="py-name">join</span><span class="py-op">(</span><span class="py-name">pts</span><span class="py-op">)</span> </span>
</div><span class="py-lineno">239</span>  <span class="py-line"> </span>
<a name="in_words"></a><div id="in_words-def"><span class="py-lineno">240</span> <a class="py-toggle" href="#" id="in_words-toggle" onclick="toggle('in_words'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#in_words">in_words</a><span class="py-op">(</span><span class="py-param">amount</span><span class="py-op">,</span> <span class="py-param">gender</span><span class="py-op">=</span><span class="py-name">None</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="in_words-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="in_words-expanded"><span class="py-lineno">241</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">242</span>  <span class="py-line"><span class="py-docstring">    Numeral in words</span> </span>
<span class="py-lineno">243</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">244</span>  <span class="py-line"><span class="py-docstring">    @param amount: numeral</span> </span>
<span class="py-lineno">245</span>  <span class="py-line"><span class="py-docstring">    @type amount: C{int} or C{float}</span> </span>
<span class="py-lineno">246</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">247</span>  <span class="py-line"><span class="py-docstring">    @param gender: gender (male=1, female=2, neuter=3)</span> </span>
<span class="py-lineno">248</span>  <span class="py-line"><span class="py-docstring">    @type gender: C{int}</span> </span>
<span class="py-lineno">249</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">250</span>  <span class="py-line"><span class="py-docstring">    @return: in-words reprsentation of numeral</span> </span>
<span class="py-lineno">251</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{unicode}</span> </span>
<span class="py-lineno">252</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">253</span>  <span class="py-line"><span class="py-docstring">    raise TypeError: when amount not C{int} or C{float}</span> </span>
<span class="py-lineno">254</span>  <span class="py-line"><span class="py-docstring">    raise ValueError: when amount is negative</span> </span>
<span class="py-lineno">255</span>  <span class="py-line"><span class="py-docstring">    raise TypeError: when gender is not C{int} (and not None)</span> </span>
<span class="py-lineno">256</span>  <span class="py-line"><span class="py-docstring">    raise ValueError: if gender isn't in (1,2,3)</span> </span>
<span class="py-lineno">257</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">258</span>  <span class="py-line">    <span id="link-42" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-42', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-43" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-43', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">)</span> </span>
<span class="py-lineno">259</span>  <span class="py-line">    <span class="py-name">gender</span> <span class="py-keyword">is</span> <span class="py-keyword">not</span> <span class="py-name">None</span> <span class="py-keyword">and</span> <span id="link-44" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-44', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-45" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-45', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'gender'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">260</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-keyword">not</span> <span class="py-op">(</span><span class="py-name">gender</span> <span class="py-keyword">is</span> <span class="py-name">None</span> <span class="py-keyword">or</span> <span class="py-number">1</span> <span class="py-op">&lt;=</span> <span class="py-name">gender</span> <span class="py-op">&lt;=</span> <span class="py-number">3</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno">261</span>  <span class="py-line">        <span class="py-keyword">raise</span> <span class="py-name">ValueError</span><span class="py-op">(</span><span class="py-string">"Gender must be male (1), female (2), "</span> <span class="py-op">+</span> \ </span>
<span class="py-lineno">262</span>  <span class="py-line">                         <span class="py-string">"neuter (3), not %d"</span> <span class="py-op">%</span> <span class="py-name">gender</span><span class="py-op">)</span> </span>
<span class="py-lineno">263</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">gender</span> <span class="py-keyword">is</span> <span class="py-name">None</span><span class="py-op">:</span> </span>
<span class="py-lineno">264</span>  <span class="py-line">        <span class="py-name">args</span> <span class="py-op">=</span> <span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span><span class="py-op">)</span> </span>
<span class="py-lineno">265</span>  <span class="py-line">    <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="py-lineno">266</span>  <span class="py-line">        <span class="py-name">args</span> <span class="py-op">=</span> <span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-name">gender</span><span class="py-op">)</span> </span>
<span class="py-lineno">267</span>  <span class="py-line">    <span class="py-comment"># &#1077;&#1089;&#1083;&#1080; &#1094;&#1077;&#1083;&#1086;&#1077;</span> </span>
<span class="py-lineno">268</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-keyword">if</span> <span class="py-name">isinstance</span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno">269</span>  <span class="py-line">        <span class="py-keyword">return</span> <span id="link-46" class="py-name"><a title="pytils.numeral.in_words_int" class="py-name" href="#" onclick="doclink('link-46', 'in_words_int', 'Function pytils.numeral.in_words_int()=pytils.numeral-module.html#in_words_int'); return false;">in_words_int</a></span></span><span class="py-op">(</span><span class="py-op">*</span><span class="py-name">args</span><span class="py-op">)</span> </span>
<span class="py-lineno">270</span>  <span class="py-line">    <span class="py-comment"># &#1077;&#1089;&#1083;&#1080; &#1076;&#1088;&#1086;&#1073;&#1085;&#1086;&#1077;</span> </span>
<span class="py-lineno">271</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-keyword">elif</span> <span class="py-name">isinstance</span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-name">float</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno">272</span>  <span class="py-line">        <span class="py-keyword">return</span> <span id="link-47" class="py-name"><a title="pytils.numeral.in_words_float" class="py-name" href="#" onclick="doclink('link-47', 'in_words_float', 'Function pytils.numeral.in_words_float()=pytils.numeral-module.html#in_words_float'); return false;">in_words_float</a></span></span><span class="py-op">(</span><span class="py-op">*</span><span class="py-name">args</span><span class="py-op">)</span> </span>
<span class="py-lineno">273</span>  <span class="py-line">    <span class="py-comment"># &#1085;&#1080; float, &#1085;&#1080; int</span> </span>
<span class="py-lineno">274</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="py-lineno">275</span>  <span class="py-line">        <span class="py-keyword">raise</span> <span class="py-name">TypeError</span><span class="py-op">(</span><span class="py-string">"Amount must be float or int, not %s"</span> <span class="py-op">%</span> \ </span>
<span class="py-lineno">276</span>  <span class="py-line">                        <span class="py-name">type</span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">)</span><span class="py-op">)</span> </span>
</div><span class="py-lineno">277</span>  <span class="py-line"> </span>
<a name="sum_string"></a><div id="sum_string-def"><span class="py-lineno">278</span> <a class="py-toggle" href="#" id="sum_string-toggle" onclick="toggle('sum_string'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#sum_string">sum_string</a><span class="py-op">(</span><span class="py-param">amount</span><span class="py-op">,</span> <span class="py-param">gender</span><span class="py-op">,</span> <span class="py-param">items</span><span class="py-op">=</span><span class="py-name">None</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="sum_string-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="sum_string-expanded"><span class="py-lineno">279</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">280</span>  <span class="py-line"><span class="py-docstring">    Get sum in words</span> </span>
<span class="py-lineno">281</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">282</span>  <span class="py-line"><span class="py-docstring">    @param amount: amount of objects</span> </span>
<span class="py-lineno">283</span>  <span class="py-line"><span class="py-docstring">    @type amount: C{int}</span> </span>
<span class="py-lineno">284</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">285</span>  <span class="py-line"><span class="py-docstring">    @param gender: gender of object (male=1, female=2, neuter=3)</span> </span>
<span class="py-lineno">286</span>  <span class="py-line"><span class="py-docstring">    @type gender: C{int}</span> </span>
<span class="py-lineno">287</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">288</span>  <span class="py-line"><span class="py-docstring">    @param items: variants of object in three forms: </span> </span>
<span class="py-lineno">289</span>  <span class="py-line"><span class="py-docstring">        for one object, for two objects and for five objects</span> </span>
<span class="py-lineno">290</span>  <span class="py-line"><span class="py-docstring">    @type items: 3-element C{sequence} of C{unicode} or</span> </span>
<span class="py-lineno">291</span>  <span class="py-line"><span class="py-docstring">        just C{unicode} (three variants with delimeter ',')</span> </span>
<span class="py-lineno">292</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">293</span>  <span class="py-line"><span class="py-docstring">    @return: in-words representation objects' amount</span> </span>
<span class="py-lineno">294</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{unicode}</span> </span>
<span class="py-lineno">295</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">296</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: input parameters' check failed</span> </span>
<span class="py-lineno">297</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: items isn't 3-element C{sequence}</span> </span>
<span class="py-lineno">298</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: amount bigger than 10**11</span> </span>
<span class="py-lineno">299</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: amount is negative</span> </span>
<span class="py-lineno">300</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">301</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">isinstance</span><span class="py-op">(</span><span class="py-name">items</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="py-lineno">302</span>  <span class="py-line">        <span class="py-name">items</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-name">i</span><span class="py-op">.</span><span class="py-name">strip</span><span class="py-op">(</span><span class="py-op">)</span> <span class="py-keyword">for</span> <span class="py-name">i</span> <span class="py-keyword">in</span> <span class="py-name">items</span><span class="py-op">.</span><span class="py-name">split</span><span class="py-op">(</span><span class="py-string">','</span><span class="py-op">)</span><span class="py-op">]</span> </span>
<span class="py-lineno">303</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">items</span> <span class="py-keyword">is</span> <span class="py-name">None</span><span class="py-op">:</span> </span>
<span class="py-lineno">304</span>  <span class="py-line">        <span class="py-name">items</span> <span class="py-op">=</span> <span class="py-op">(</span><span class="py-string">u""</span><span class="py-op">,</span> <span class="py-string">u""</span><span class="py-op">,</span> <span class="py-string">u""</span><span class="py-op">)</span> </span>
<span class="py-lineno">305</span>  <span class="py-line"> </span>
<span class="py-lineno">306</span>  <span class="py-line">    <span id="link-48" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-48', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-49" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-49', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'items'</span><span class="py-op">,</span> <span class="py-op">(</span><span class="py-name">list</span><span class="py-op">,</span> <span class="py-name">tuple</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">307</span>  <span class="py-line"> </span>
<span class="py-lineno">308</span>  <span class="py-line">    <span class="py-keyword">try</span><span class="py-op">:</span> </span>
<span class="py-lineno">309</span>  <span class="py-line">        <span class="py-name">one_item</span><span class="py-op">,</span> <span class="py-name">two_items</span><span class="py-op">,</span> <span class="py-name">five_items</span> <span class="py-op">=</span> <span class="py-name">items</span> </span>
<span class="py-lineno">310</span>  <span class="py-line">    <span class="py-keyword">except</span> <span class="py-name">ValueError</span><span class="py-op">:</span> </span>
<span class="py-lineno">311</span>  <span class="py-line">        <span class="py-keyword">raise</span> <span class="py-name">ValueError</span><span class="py-op">(</span><span class="py-string">"Items must be 3-element sequence"</span><span class="py-op">)</span> </span>
<span class="py-lineno">312</span>  <span class="py-line"> </span>
<span class="py-lineno">313</span>  <span class="py-line">    <span id="link-50" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-50', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-51" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-51', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">314</span>  <span class="py-line">    <span id="link-52" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-52', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-53" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-53', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'gender'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">315</span>  <span class="py-line">    <span id="link-54" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-54', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-55" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-55', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'one_item'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">316</span>  <span class="py-line">    <span id="link-56" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-56', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-57" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-57', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'two_items'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">317</span>  <span class="py-line">    <span id="link-58" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-58', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-59" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-59', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'five_items'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">318</span>  <span class="py-line">    <span id="link-60" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-60', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-61" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-61', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'amount'</span><span class="py-op">)</span> </span>
<span class="py-lineno">319</span>  <span class="py-line">     </span>
<span class="py-lineno">320</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">amount</span> <span class="py-op">==</span> <span class="py-number">0</span><span class="py-op">:</span> </span>
<span class="py-lineno">321</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-string">u"&#1085;&#1086;&#1083;&#1100; %s"</span> <span class="py-op">%</span> <span class="py-name">five_items</span> </span>
<span class="py-lineno">322</span>  <span class="py-line"> </span>
<span class="py-lineno">323</span>  <span class="py-line">    <span class="py-name">into</span> <span class="py-op">=</span> <span class="py-string">u''</span> </span>
<span class="py-lineno">324</span>  <span class="py-line">    <span class="py-name">tmp_val</span> <span class="py-op">=</span> <span class="py-name">amount</span> </span>
<span class="py-lineno">325</span>  <span class="py-line"> </span>
<span class="py-lineno">326</span>  <span class="py-line">    <span class="py-comment"># &#1077;&#1076;&#1080;&#1085;&#1080;&#1094;&#1099;</span> </span>
<span class="py-lineno">327</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> <span class="py-op">=</span> <span id="link-62" class="py-name"><a title="pytils.numeral._sum_string_fn" class="py-name" href="#" onclick="doclink('link-62', '_sum_string_fn', 'Function pytils.numeral._sum_string_fn()=pytils.numeral-module.html#_sum_string_fn'); return false;">_sum_string_fn</a></span></span><span class="py-op">(</span><span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span><span class="py-op">,</span> <span class="py-name">gender</span><span class="py-op">,</span> <span class="py-name">items</span><span class="py-op">)</span> </span>
<span class="py-lineno">328</span>  <span class="py-line">    <span class="py-comment"># &#1090;&#1099;&#1089;&#1103;&#1095;&#1080;</span> </span>
<span class="py-lineno">329</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> <span class="py-op">=</span> <span id="link-63" class="py-name"><a title="pytils.numeral._sum_string_fn" class="py-name" href="#" onclick="doclink('link-63', '_sum_string_fn', 'Function pytils.numeral._sum_string_fn()=pytils.numeral-module.html#_sum_string_fn'); return false;">_sum_string_fn</a></span></span><span class="py-op">(</span><span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span><span class="py-op">,</span> <span class="py-number">2</span><span class="py-op">,</span> </span>
<span class="py-lineno">330</span>  <span class="py-line">                                    <span class="py-op">(</span><span class="py-string">u"&#1090;&#1099;&#1089;&#1103;&#1095;&#1072;"</span><span class="py-op">,</span> <span class="py-string">u"&#1090;&#1099;&#1089;&#1103;&#1095;&#1080;"</span><span class="py-op">,</span> <span class="py-string">u"&#1090;&#1099;&#1089;&#1103;&#1095;"</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">331</span>  <span class="py-line">    <span class="py-comment"># &#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1099;</span> </span>
<span class="py-lineno">332</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> <span class="py-op">=</span> <span id="link-64" class="py-name"><a title="pytils.numeral._sum_string_fn" class="py-name" href="#" onclick="doclink('link-64', '_sum_string_fn', 'Function pytils.numeral._sum_string_fn()=pytils.numeral-module.html#_sum_string_fn'); return false;">_sum_string_fn</a></span></span><span class="py-op">(</span><span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span><span class="py-op">,</span> <span class="py-number">1</span><span class="py-op">,</span> </span>
<span class="py-lineno">333</span>  <span class="py-line">                                    <span class="py-op">(</span><span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1072;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1086;&#1085;&#1086;&#1074;"</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">334</span>  <span class="py-line">    <span class="py-comment"># &#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;&#1099;</span> </span>
<span class="py-lineno">335</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> <span class="py-op">=</span> <span id="link-65" class="py-name"><a title="pytils.numeral._sum_string_fn" class="py-name" href="#" onclick="doclink('link-65', '_sum_string_fn', 'Function pytils.numeral._sum_string_fn()=pytils.numeral-module.html#_sum_string_fn'); return false;">_sum_string_fn</a></span></span><span class="py-op">(</span><span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span><span class="py-op">,</span> <span class="py-number">1</span><span class="py-op">,</span> </span>
<span class="py-lineno">336</span>  <span class="py-line">                                    <span class="py-op">(</span><span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;&#1072;"</span><span class="py-op">,</span> <span class="py-string">u"&#1084;&#1080;&#1083;&#1083;&#1080;&#1072;&#1088;&#1076;&#1086;&#1074;"</span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="py-lineno">337</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">tmp_val</span> <span class="py-op">==</span> <span class="py-number">0</span><span class="py-op">:</span> </span>
<span class="py-lineno">338</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">into</span> </span>
<span class="py-lineno">339</span>  <span class="py-line">    <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="py-lineno">340</span>  <span class="py-line">        <span class="py-keyword">raise</span> <span class="py-name">ValueError</span><span class="py-op">(</span><span class="py-string">"Cannot operand with numbers bigger than 10**11"</span><span class="py-op">)</span> </span>
</div><span class="py-lineno">341</span>  <span class="py-line"> </span>
<a name="_sum_string_fn"></a><div id="_sum_string_fn-def"><span class="py-lineno">342</span> <a class="py-toggle" href="#" id="_sum_string_fn-toggle" onclick="toggle('_sum_string_fn'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="pytils.numeral-module.html#_sum_string_fn">_sum_string_fn</a><span class="py-op">(</span><span class="py-param">into</span><span class="py-op">,</span> <span class="py-param">tmp_val</span><span class="py-op">,</span> <span class="py-param">gender</span><span class="py-op">,</span> <span class="py-param">items</span><span class="py-op">=</span><span class="py-name">None</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="_sum_string_fn-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_sum_string_fn-expanded"><span class="py-lineno">343</span>  <span class="py-line">    <span class="py-docstring">"""</span> </span>
<span class="py-lineno">344</span>  <span class="py-line"><span class="py-docstring">    Make in-words representation of single order</span> </span>
<span class="py-lineno">345</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">346</span>  <span class="py-line"><span class="py-docstring">    @param into: in-words representation of lower orders</span> </span>
<span class="py-lineno">347</span>  <span class="py-line"><span class="py-docstring">    @type into: C{unicode}</span> </span>
<span class="py-lineno">348</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">349</span>  <span class="py-line"><span class="py-docstring">    @param tmp_val: temporary value without lower orders</span> </span>
<span class="py-lineno">350</span>  <span class="py-line"><span class="py-docstring">    @type tmp_val: C{int} </span> </span>
<span class="py-lineno">351</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">352</span>  <span class="py-line"><span class="py-docstring">    @param gender: gender (male=1, female=2, neuter=3)</span> </span>
<span class="py-lineno">353</span>  <span class="py-line"><span class="py-docstring">    @type gender: C{int}</span> </span>
<span class="py-lineno">354</span>  <span class="py-line"><span class="py-docstring">    </span> </span>
<span class="py-lineno">355</span>  <span class="py-line"><span class="py-docstring">    @param items: variants of objects</span> </span>
<span class="py-lineno">356</span>  <span class="py-line"><span class="py-docstring">    @type items: 3-element C{sequence} of C{unicode}</span> </span>
<span class="py-lineno">357</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">358</span>  <span class="py-line"><span class="py-docstring">    @return: new into and tmp_val</span> </span>
<span class="py-lineno">359</span>  <span class="py-line"><span class="py-docstring">    @rtype: C{tuple}</span> </span>
<span class="py-lineno">360</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="py-lineno">361</span>  <span class="py-line"><span class="py-docstring">    @raise TypeError: input parameters' check failed</span> </span>
<span class="py-lineno">362</span>  <span class="py-line"><span class="py-docstring">    @raise ValueError: tmp_val is negative</span> </span>
<span class="py-lineno">363</span>  <span class="py-line"><span class="py-docstring">    """</span> </span>
<span class="py-lineno">364</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">items</span> <span class="py-keyword">is</span> <span class="py-name">None</span><span class="py-op">:</span> </span>
<span class="py-lineno">365</span>  <span class="py-line">        <span class="py-name">items</span> <span class="py-op">=</span> <span class="py-op">(</span><span class="py-string">u""</span><span class="py-op">,</span> <span class="py-string">u""</span><span class="py-op">,</span> <span class="py-string">u""</span><span class="py-op">)</span> </span>
<span class="py-lineno">366</span>  <span class="py-line">    <span class="py-name">one_item</span><span class="py-op">,</span> <span class="py-name">two_items</span><span class="py-op">,</span> <span class="py-name">five_items</span> <span class="py-op">=</span> <span class="py-name">items</span> </span>
<span class="py-lineno">367</span>  <span class="py-line">    <span id="link-66" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-66', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-67" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-67', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'into'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">368</span>  <span class="py-line">    <span id="link-68" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-68', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-69" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-69', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'tmp_val'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">369</span>  <span class="py-line">    <span id="link-70" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-70', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-71" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-71', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'gender'</span><span class="py-op">,</span> <span class="py-name">int</span><span class="py-op">)</span> </span>
<span class="py-lineno">370</span>  <span class="py-line">    <span id="link-72" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-72', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-73" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-73', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'one_item'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">371</span>  <span class="py-line">    <span id="link-74" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-74', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-75" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-75', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'two_items'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">372</span>  <span class="py-line">    <span id="link-76" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-76', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-77" class="py-name"><a title="pytils.utils.check_type" class="py-name" href="#" onclick="doclink('link-77', 'check_type', 'Function pytils.utils.check_type()=pytils.utils-module.html#check_type'); return false;">check_type</a></span></span><span class="py-op">(</span><span class="py-string">'five_items'</span><span class="py-op">,</span> <span class="py-name">unicode</span><span class="py-op">)</span> </span>
<span class="py-lineno">373</span>  <span class="py-line">    <span id="link-78" class="py-name"><a title="pytils.utils" class="py-name" href="#" onclick="doclink('link-78', 'utils', 'Module pytils.utils=pytils.utils-module.html'); return false;">utils</a></span></span><span class="py-op">.</span><span id="link-79" class="py-name"><a title="pytils.utils.check_positive" class="py-name" href="#" onclick="doclink('link-79', 'check_positive', 'Function pytils.utils.check_positive()=pytils.utils-module.html#check_positive'); return false;">check_positive</a></span></span><span class="py-op">(</span><span class="py-string">'tmp_val'</span><span class="py-op">)</span> </span>
<span class="py-lineno">374</span>  <span class="py-line"> </span>
<span class="py-lineno">375</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">tmp_val</span> <span class="py-op">==</span> <span class="py-number">0</span><span class="py-op">:</span> </span>
<span class="py-lineno">376</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> </span>
<span class="py-lineno">377</span>  <span class="py-line"> </span>
<span class="py-lineno">378</span>  <span class="py-line">    <span class="py-name">rest</span> <span class="py-op">=</span> <span class="py-name">rest1</span> <span class="py-op">=</span> <span class="py-name">end_word</span> <span class="py-op">=</span> <span class="py-name">None</span> </span>
<span class="py-lineno">379</span>  <span class="py-line">    <span class="py-name">words</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="py-lineno">380</span>  <span class="py-line"> </span>
<span class="py-lineno">381</span>  <span class="py-line">    <span class="py-name">rest</span> <span class="py-op">=</span> <span class="py-name">tmp_val</span> <span class="py-op">%</span> <span class="py-number">1000</span> </span>
<span class="py-lineno">382</span>  <span class="py-line">    <span class="py-name">tmp_val</span> <span class="py-op">=</span> <span class="py-name">tmp_val</span> <span class="py-op">/</span> <span class="py-number">1000</span> </span>
<span class="py-lineno">383</span>  <span class="py-line">    <span class="py-keyword">if</span> <span class="py-name">rest</span> <span class="py-op">==</span> <span class="py-number">0</span><span class="py-op">:</span> </span>
<span class="py-lineno">384</span>  <span class="py-line">        <span class="py-comment"># &#1087;&#1086;&#1089;&#1083;&#1077;&#1076;&#1085;&#1080;&#1077; &#1090;&#1088;&#1080; &#1079;&#1085;&#1072;&#1082;&#1072; &#1085;&#1091;&#1083;&#1077;&#1074;&#1099;&#1077;</span> </span>
<span class="py-lineno">385</span>  <span class="py-line"><span class="py-comment"></span>        <span class="py-keyword">if</span> <span class="py-name">into</span> <span class="py-op">==</span> <span class="py-string">u""</span><span class="py-op">:</span> </span>
<span class="py-lineno">386</span>  <span class="py-line">            <span class="py-name">into</span> <span class="py-op">=</span> <span class="py-string">u"%s "</span> <span class="py-op">%</span> <span class="py-name">five_items</span> </span>
<span class="py-lineno">387</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">into</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> </span>
<span class="py-lineno">388</span>  <span class="py-line"> </span>
<span class="py-lineno">389</span>  <span class="py-line">    <span class="py-comment"># &#1085;&#1072;&#1095;&#1080;&#1085;&#1072;&#1077;&#1084; &#1087;&#1086;&#1076;&#1089;&#1095;&#1077;&#1090; &#1089; rest</span> </span>
<span class="py-lineno">390</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">end_word</span> <span class="py-op">=</span> <span class="py-name">five_items</span> </span>
<span class="py-lineno">391</span>  <span class="py-line"> </span>
<span class="py-lineno">392</span>  <span class="py-line">    <span class="py-comment"># &#1089;&#1086;&#1090;&#1085;&#1080;</span> </span>
<span class="py-lineno">393</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">words</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-80" class="py-name"><a title="pytils.numeral.HUNDREDS" class="py-name" href="#" onclick="doclink('link-80', 'HUNDREDS', 'Variable pytils.numeral.HUNDREDS=pytils.numeral-module.html#HUNDREDS'); return false;">HUNDREDS</a></span></span><span class="py-op">[</span><span class="py-name">rest</span> <span class="py-op">/</span> <span class="py-number">100</span><span class="py-op">]</span><span class="py-op">)</span> </span>
<span class="py-lineno">394</span>  <span class="py-line"> </span>
<span class="py-lineno">395</span>  <span class="py-line">    <span class="py-comment"># &#1076;&#1077;&#1089;&#1103;&#1090;&#1082;&#1080;</span> </span>
<span class="py-lineno">396</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">rest</span> <span class="py-op">=</span> <span class="py-name">rest</span> <span class="py-op">%</span> <span class="py-number">100</span> </span>
<span class="py-lineno">397</span>  <span class="py-line">    <span class="py-name">rest1</span> <span class="py-op">=</span> <span class="py-name">rest</span> <span class="py-op">/</span> <span class="py-number">10</span> </span>
<span class="py-lineno">398</span>  <span class="py-line">    <span class="py-comment"># &#1086;&#1089;&#1086;&#1073;&#1099;&#1081; &#1089;&#1083;&#1091;&#1095;&#1072;&#1081; -- tens=1</span> </span>
<span class="py-lineno">399</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">tens</span> <span class="py-op">=</span> <span class="py-name">rest1</span> <span class="py-op">==</span> <span class="py-number">1</span> <span class="py-keyword">and</span> <span id="link-81" class="py-name"><a title="pytils.numeral.TENS" class="py-name" href="#" onclick="doclink('link-81', 'TENS', 'Variable pytils.numeral.TENS=pytils.numeral-module.html#TENS'); return false;">TENS</a></span></span><span class="py-op">[</span><span class="py-name">rest</span><span class="py-op">]</span> <span class="py-keyword">or</span> <span id="link-82" class="py-name"><a title="pytils.numeral.TENS" class="py-name" href="#" onclick="doclink('link-82', 'TENS', 'Variable pytils.numeral.TENS=pytils.numeral-module.html#TENS'); return false;">TENS</a></span></span><span class="py-op">[</span><span class="py-name">rest1</span><span class="py-op">]</span> </span>
<span class="py-lineno">400</span>  <span class="py-line">    <span class="py-name">words</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">tens</span><span class="py-op">)</span> </span>
<span class="py-lineno">401</span>  <span class="py-line"> </span>
<span class="py-lineno">402</span>  <span class="py-line">    <span class="py-comment"># &#1077;&#1076;&#1080;&#1085;&#1080;&#1094;&#1099;</span> </span>
<span class="py-lineno">403</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-keyword">if</span> <span class="py-name">rest1</span> <span class="py-op">&lt;</span> <span class="py-number">1</span> <span class="py-keyword">or</span> <span class="py-name">rest1</span> <span class="py-op">&gt;</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="py-lineno">404</span>  <span class="py-line">        <span class="py-name">amount</span> <span class="py-op">=</span> <span class="py-name">rest</span> <span class="py-op">%</span> <span class="py-number">10</span> </span>
<span class="py-lineno">405</span>  <span class="py-line">        <span class="py-name">end_word</span> <span class="py-op">=</span> <span id="link-83" class="py-name"><a title="pytils.numeral.choose_plural
pytils.templatetags.pytils_numeral.choose_plural" class="py-name" href="#" onclick="doclink('link-83', 'choose_plural', 'Function pytils.numeral.choose_plural()=pytils.numeral-module.html#choose_plural,Function pytils.templatetags.pytils_numeral.choose_plural()=pytils.templatetags.pytils_numeral-module.html#choose_plural'); return false;">choose_plural</a></span></span><span class="py-op">(</span><span class="py-name">amount</span><span class="py-op">,</span> <span class="py-name">items</span><span class="py-op">)</span> </span>
<span class="py-lineno">406</span>  <span class="py-line">        <span class="py-name">words</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-84" class="py-name"><a title="pytils.numeral.ONES" class="py-name" href="#" onclick="doclink('link-84', 'ONES', 'Variable pytils.numeral.ONES=pytils.numeral-module.html#ONES'); return false;">ONES</a></span></span><span class="py-op">[</span><span class="py-name">amount</span><span class="py-op">]</span><span class="py-op">[</span><span class="py-name">gender</span><span class="py-op">-</span><span class="py-number">1</span><span class="py-op">]</span><span class="py-op">)</span> </span>
<span class="py-lineno">407</span>  <span class="py-line">    <span class="py-name">words</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">end_word</span><span class="py-op">)</span> </span>
<span class="py-lineno">408</span>  <span class="py-line"> </span>
<span class="py-lineno">409</span>  <span class="py-line">    <span class="py-comment"># &#1076;&#1086;&#1073;&#1072;&#1074;&#1083;&#1103;&#1077;&#1084; &#1090;&#1086;, &#1095;&#1090;&#1086; &#1091;&#1078;&#1077; &#1073;&#1099;&#1083;&#1086;</span> </span>
<span class="py-lineno">410</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">words</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">into</span><span class="py-op">)</span> </span>
<span class="py-lineno">411</span>  <span class="py-line"> </span>
<span class="py-lineno">412</span>  <span class="py-line">    <span class="py-comment"># &#1091;&#1073;&#1080;&#1088;&#1072;&#1077;&#1084; &#1087;&#1091;&#1089;&#1090;&#1099;&#1077; &#1087;&#1086;&#1076;&#1089;&#1090;&#1088;&#1086;&#1082;&#1080;</span> </span>
<span class="py-lineno">413</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-name">words</span> <span class="py-op">=</span> <span class="py-name">filter</span><span class="py-op">(</span><span class="py-keyword">lambda</span> <span id="link-85" class="py-name"><a title="pytils.translit.x" class="py-name" href="#" onclick="doclink('link-85', 'x', 'Variable pytils.translit.x=pytils.translit-module.html#x'); return false;">x</a></span></span><span class="py-op">:</span> <span class="py-name">len</span><span class="py-op">(</span><span id="link-86" class="py-name"><a title="pytils.translit.x" class="py-name" href="#" onclick="doclink('link-86', 'x', 'Variable pytils.translit.x=pytils.translit-module.html#x'); return false;">x</a></span></span><span class="py-op">)</span> <span class="py-op">&gt;</span> <span class="py-number">0</span><span class="py-op">,</span> <span class="py-name">words</span><span class="py-op">)</span> </span>
<span class="py-lineno">414</span>  <span class="py-line"> </span>
<span class="py-lineno">415</span>  <span class="py-line">    <span class="py-comment"># &#1089;&#1082;&#1083;&#1077;&#1080;&#1074;&#1072;&#1077;&#1084; &#1080; &#1086;&#1090;&#1076;&#1072;&#1077;&#1084;</span> </span>
<span class="py-lineno">416</span>  <span class="py-line"><span class="py-comment"></span>    <span class="py-keyword">return</span> <span class="py-string">u" "</span><span class="py-op">.</span><span class="py-name">join</span><span class="py-op">(</span><span class="py-name">words</span><span class="py-op">)</span><span class="py-op">.</span><span class="py-name">strip</span><span class="py-op">(</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-name">tmp_val</span> </span>
</div><span class="py-lineno">417</span>  <span class="py-line"> </span><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pytils-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha3 on Sun Oct 29 00:35:03 2006</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
